home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 1993 May / Info-Mac_II_May_1993.to_.sit / Info-Mac II (May 1993).toast / Technical / Sound Tracker Tips.txt < prev    next >
Internet Message Format  |  1992-08-29  |  6KB

  1. Date: Thu, 19 MAR 92 15:12 N 
  2. From: USER%PISA.INFN.IT@ICINECA.CINECA.IT
  3. Subject: SoundTracker ( lots of (A)'s ) 
  4.  
  5. Dea Netters
  6. in the last days i have seen a lot of curiosity around
  7. the Mac SoundTracker.
  8. The questions were
  9. (i)     how can many minutes of sound be compressed in a few tens of
  10.         kilobytes and then expanded in real-time ?
  11. (ii)            how can i write a song like those we see at info-mac
  12.         and at ab20.larc.nasa.gov ?
  13. (iii)   why do some songs fail to work on the mac ?
  14. I haVE   answers for the three questions.
  15. (i)     indeed nothing is compressed in the MOD files.
  16.         there is a collection of usually very short ( most are 3-8 k )
  17.         sampled instruments, and tradition is that they play an F (Fa for
  18.         italian and french people), the one at more or less 698 Hz, when
  19.         8000 samples are sent to the speaker every second.
  20.         Then you have a short, compact ( not compressed ) description of
  21.         the song. That is every note is specified by its instrument (
  22.         which can be, of course, anything, including obscenities like
  23.         those we are accustomed to hear in obnoxious tetris when we
  24.         have DISINFECTED it ... by the way ... GOD BLESS JOHN NORSTAD ..
  25.         but i digress ).
  26.         I wrote, every note is specified by its instrument, its duration,
  27.         its pitch and some additional effect ( portato, glissato, arpeggio)
  28.         etc. etc. .
  29.         Indeed SoundTracker does something different. At regular andclose
  30.         intervals of time it reads a command from a queue, and these
  31.         commands may be :
  32.         ((i))   silent the track
  33.         ((ii))  start playing a sound with specified pitch and instrument
  34.                 from a track, and with particular effect if any
  35.         ((iii)) add an effect to a track which is playing.
  36.         ((iv))  go on retrieving further commands from another queue of
  37.                 those ( like a GO TO , spaghetti music i'd say )
  38.         there are more 'queues' of commands, every queue contains exactly
  39.         64 commands for each of the four tracks, and when one is exausted
  40.         another queue is played.
  41.         On the Amiga everything is easy to do: just redirect those commands
  42.         to the four Digital/Analog converters built in in hardware and
  43.         hear the sounds forming a full-fledged orchestral score or a
  44.         cluster of meaningless sounds depending on the ability and the
  45.         musical skill of the composer.
  46.         This redirection is done by the CPU ( a mere 68000 is even too
  47.         much ) during interrupt time, and requires almost no CPU load.
  48.         On the Mac you don't have DMA that feeds automatically the D/A
  49.         converter, but the CPU itself has to read the data from the
  50.         samples, resample them by reading the same sample more times
  51.         or stepping some samples, or even doing some complicated
  52.         sort of linear interpolation, THIS must be done for each
  53.         of the four 'virtual tracks', and the final four so obtained
  54.         buffers must then be added and the sum feeds the small buffer
  55.         inside the Apple SOund Chip. Gosh ! I think i have gone
  56.         too technical. Anyway Apple helps us : it provides an efficient
  57.         double-buffering mechanism to do this, and it is described
  58.         clearly in IM volume VI. If you want to see another
  59.         application of it download Storm and StormSound Kit to have
  60.         sources.
  61.         All that work that has to be done by the poor CPU is so hard
  62.         that on a mere LC (16Mhz 68020) you spend 25% cpu time to hav
  63.         NON anti-aliased 22Khz sound. But You'll enjoy it greatly.
  64.         Sources for Play routines on the Amiga should be available
  65.         on the main Amiga BBS services, for those more interested
  66.         in technical details and yet didn't want to kill me for what i've
  67.         written.
  68. (iI)    at the moment the Only way to have a module is to write it
  69.         on an Amiga, as far as I Know. I have some Modules i Have written
  70.         home, if You are curious and you hate Your ears i'll upload them
  71.         to sumex-aim.
  72. (iii)   there is more than one soundtracker for the Amiga, and not all
  73.         of them are compatible. MED for example i believe is one of those
  74.         which are incompatible with ST and NT (NoiseTracker, and enhanced
  75.         version of SoundTracker, but there are subtle incompatibilities
  76.         which don't cause crashes but some strange noises may occur)
  77. This isn't all, folks, eventhe sound representation is different on the
  78. two hardwares. Ranges of samples on the Amiga are -128...127 while
  79. on the Mac the range is 0...255. That is that to convert a sound from
  80. Amiga to Mac you just have to add $80( or 0x80 or 128, who prefers)
  81. to every byte of the Amiga Raw Data and Reduce the value modulo 256.
  82. Bingo, That's all I know, folks, i hope your curiosity is satisfied.
  83.                         Roberto Avanzi Mocenigo
  84.                         Dept. of Pure and Applied Mathematics
  85.                         University of Padova. ( 2nd year student )
  86.                         author of Bob's Eyes Pro
  87.                         member of the Tron 3.0 team ( early alpha stage)
  88.                         email   cossip@vaxsns.infn.it or
  89.                                 danieli@hp800.bio.unipd.it
  90.                         home    Via Luigi Balzan 12
  91.                                 45100   Rovigo
  92.                                 Italy.
  93. this stuff may find its place in the tech directory , other than in the
  94. digests.
  95.  
  96.  
  97.